<%--
  Created by IntelliJ IDEA.
  User: wens
  Date: 2017/5/14
  Time: 下午9:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>公众号配置</title>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>

<div id="app">
    <h5>菜单配置</h5>
    <div>
        <textarea v-model="menu" cols="100" rows="10"></textarea>
        <br/>
        <button type="button" @click="saveMenu">保存</button>
    </div>
</div>
<script>
    var _ctx = '${pageContext.request.contextPath}'
    var app = new Vue({
        el: '#app',
        data: {
            menu : ''
        },
        methods:{
            saveMenu:function(){
                var _this  = this
                $.post(_ctx + '/saveMenu',{
                    menu : _this.menu
                },function(ret){
                    if(ret.success){
                        alert('OK')
                    }else{
                        alert(ret.desc)
                    }
                },'json')
            }
        }
    })

</script>

</body>
</html>
